package com.qk.common.Util;

/**
 * @author: zyx
 * @created: 2025-10-14-19:32
 * @description: 当前用户上下文处理器
 */
public class CurrentUserContextHolders {


    private static final ThreadLocal<Integer> USER_CONTEXT = new ThreadLocal<>();

    //构造私有化
    private CurrentUserContextHolders() {}

    public static void set(Integer userId) {
        USER_CONTEXT.set(userId);
    }
    public static Integer get() {
        return USER_CONTEXT.get();
    }
    public static void remove() {
        USER_CONTEXT.remove();
    }
}
